package com.turtle3d.user.grammars;

import com.turtle3d.formallanguage.grammar.Grammar;
import com.turtle3d.formallanguage.parser.SimpleParser;
import com.turtle3d.formallanguage.symbol.Symbol;
import com.turtle3d.formallanguage.symbol.SymbolFactory;

/**
 * Very simple tree structure.
 * @author Marek Paterczyk <marek.paterczyk@gmail.com>
 *
 */
public class Tree extends Grammar
{	
	
	public void define(){
		
		Symbol axiom = SymbolFactory.getSymbolFactory().createSymbolofClass("B");	
		setAxiom(axiom);														
		
		addProduction(SimpleParser.parseProduction("B->F[+B][>+B][>>+B][B]"));
		addProduction(SimpleParser.parseProduction("F->FF"));
	}
	
	public void setRequiredParameters(){
		setRequiredParameter(Symbol.RADIUS, 0.03f);		
		setRequiredParameter(Symbol.DISTANCE, 0.2f);					
		setRequiredParameter(Symbol.TURN_ANGLE, 45f);
		setRequiredParameter(Symbol.ROLL_ANGLE, 120f);						
	}

}
